use "C:\Users\jkbrueck\Documents\STATA\Fuel 3\aviation2.dta", clear

keep if year >= 2015 & year <= 2019

rename carrier airline

gen type = "."
        
replace type = "A320-200" if aircraft_name == "Airbus Industrie A320-100/200"       
replace type = "737-400" if aircraft_name == "Boeing 737-400"     
replace type = "747-400" if aircraft_name == "Boeing 747-400"     
replace type = "757-200" if aircraft_name == "Boeing 757-200"     
replace type = "767-300ER" if aircraft_name == "Boeing 767-300/300ER"

drop if type == "."

gen gallons = aircraft_fuels_921

rename year retyr

keep airline type retyr gallons

collapse (mean) gallons, by(type airline retyr)

save "C:\Users\jkbrueck\Documents\STATA\Fuel 4\US data\fuel usage.dta", replace
    
     
